<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="d" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title></title>
    <script type="text/javascript" src="${pageContext.request.contextPath}/statics/admin/js/javascript.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/statics/admin/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/statics/admin/css/admin.css"/>
</head>

<body>

<div class="layui-tab" style="margin-right: 10px" lay-filter="favorite">
    <a style="margin: 10pt 10pt" class="layui-btn layui-btn-primary"
       href="${pageContext.request.contextPath}/admin/toUserList.do">返回</a>
    <ul class="layui-tab-title">
        <li class="layui-this">单词历史</li>
        <li>视听历史</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <div class="wrap-container clearfix">
                <div class="column-content-detail">
                    <div id="table-list">
                        <table class="layui-table" lay-even lay-skin="nob">
                            <colgroup>
                                <col class="hidden-xs" width="50">
                                <col class="hidden-xs" width="80">
                                <col class="hidden-xs" width="160">
                                <col class="hidden-xs" width="160">
                                <col class="hidden-xs" width="160">
                                <col class="hidden-xs" width="160">
                            </colgroup>
                            <thead>
                            <tr>
                                <th class="hidden-xs"><b>ID</b></th>
                                <th class="hidden-xs"><b>单词</b></th>
                                <th class="hidden-xs"><b>翻译</b></th>
                                <th class="hidden-xs"><b>词性</b></th>
                                <th class="hidden-xs"><b>释义</b></th>
                                <th class="hidden-xs"><b>例句</b></th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:if test="${empty dictionaryList}">
                                <tr>
                                    <td colspan="6">
                                        <p style="color: red;text-align: center">该用户没有历史单词</p>
                                    </td>
                                </tr>
                            </c:if>
                            <c:if test="${not empty dictionaryList}">
                                <c:forEach items="${dictionaryList.get(0).dictionaryList }" var="dic">
                                    <tr>
                                        <td class="hidden-xs">${dic.dictionaryId}</td>
                                        <td class="hidden-xs">${dic.word}</td>
                                        <td class="hidden-xs">
                                            <label>
                                    <textarea class="layui-textarea" readonly cols=""
                                              rows="">${dic.translation.trim()}</textarea>
                                            </label>
                                        </td>
                                        <td class="hidden-xs">
                                            <label>
                                    <textarea class="layui-textarea" readonly cols="" rows="">
                                        <c:if test="${empty dic.comment}">无</c:if>
                                        <c:if test="${not empty dic.comment}">${dic.comment.trim()}</c:if>
                                    </textarea>
                                            </label>
                                        </td>
                                        <td class="hidden-xs">
                                            <label>
                                    <textarea class="layui-textarea" readonly cols="" rows="">
                                        <c:if test="${empty dic.mean}">无</c:if>
                                        <c:if test="${not empty dic.mean}">${dic.mean.trim()}</c:if>
                                    </textarea>
                                            </label>
                                        </td>
                                        <td class="hidden-xs">
                                            <label>
                                    <textarea class="layui-textarea" readonly cols="" rows="">
                                        <c:if test="${empty dic.example}">无</c:if>
                                        <c:if test="${not empty dic.example}">${dic.example.trim()}</c:if>
                                    </textarea>
                                            </label>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:if>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-tab-item" lay-id="resources">
            <div class="wrap-container clearfix">
                <div class="column-content-detail">
                    <table class="layui-table" lay-even lay-skin="nob">
                        <colgroup>
                            <col class="hidden-xs" width="50">
                            <col class="hidden-xs" width="120">
                            <col class="hidden-xs" width="100">
                            <col class="hidden-xs" width="150">
                            <col class="hidden-xs" width="150">
                        </colgroup>
                        <thead>
                        <tr>
                            <th class="hidden-xs"><b>ID</b></th>
                            <th class="hidden-xs"><b>名称</b></th>
                            <th class="hidden-xs"><b>视听资源预览</b></th>
                            <th class="hidden-xs"><b>分类</b></th>
                            <th class="hidden-xs"><b>描述</b></th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:if test="${empty resourcesList}">
                            <tr>
                                <td colspan="5">
                                    <p style="color: red;text-align: center">该用户没有历史视听资源</p>
                                </td>
                            </tr>
                        </c:if>
                        <c:if test="${not empty resourcesList}">
                            <c:forEach items="${resourcesList.get(0).resourcesList}" var="res">
                                <tr>
                                    <td class="hidden-xs">${res.resourceId}</td>
                                    <td class="hidden-xs">${res.name}</td>
                                    <td class="hidden-xs">
                                        <video src="${res.url}" poster="url" controls="controls" width="200"
                                               height="100"></video>
                                    </td>
                                    <td class="hidden-xs">${res.classification}</td>
                                    <td class="hidden-xs">${res.description}</td>
                                </tr>
                            </c:forEach>
                        </c:if>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <script src="${pageContext.request.contextPath}/statics/admin/layui/layui.js" type="text/javascript"
            charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/statics/admin/js/common.js" type="text/javascript"
            charset="utf-8"></script>
    <script type="text/javascript">
        layui.use('element', function () {
            var element = layui.element;
            element.tabChange('favorite', 'resources');
        })
    </script>
</body>
</html>
